﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Import.Exceptions
{
    [Serializable]
    public class ScriptImportException : Exception
    {
        [Serializable]
        public class HeaderExceptionInfo
        {
            public CellInfo[] HeaderDataInfo { get; set; }
        }

        [Serializable]
        public class DialogueExceptionInfo
        {
            public DialogueExceptionInfo(string timeCode, string character, string dialogue)
            {
                this.TimeCode = timeCode;
                this.Character = character;
                this.Dialogue = dialogue;
            }
            public string TimeCode { get; set; }
            public string Character { get; set; }
            public string Dialogue { get; set; }
        }
            
        public int? PageNumber { get; set; }
        public int? RowNumber { get; set; }
        public CellInfo[] HeaderDataInfo { get; set; }
        public DialogueExceptionInfo DialogueInfo1 { get; set; }
        public DialogueExceptionInfo DialogueInfo2 { get; set; }
        public string ErrorMessage { get; set; }

        public ScriptImportException(Exception exception)
            : base(exception != null ? exception.Message : String.Empty, exception)
        {
        }

        //public override string Message
        //{
        //    get
        //    {
        //        //return string.Format("My message: {0}, {1}", Field, FieldValue);
        //        return String.Format("{0}{1}.", base.Message, this.RowNumber != null ? " en el diálogo <b>N° " + this.RowNumber  + "</b>": String.Empty);
        //    }
        //}
    }

}
